<?php
require_once(dirname(dirname(__FILE__)).'/init.php');

/**
* Index 
* shouxue
* 2017/10/26 
*/
class Index extends Base
{
	
	//初始化
	function __construct($Ioc)
	{
		//载入可访问区域
		$this->Method = array('test','');
		$this->Ioc 	  = $Ioc;
			
	}


    /**
     * Description: 主体服务
     * User: shouxue
     * Date: 2017/10/27
     */
    public function main($mode)
    {

        if (!$this->isMethod($mode)) {
            $this->Ioc->Response->min(212, '请求服务不存在','',$this ->out_mode);
        }

        $data = array();
        //接入Api
        switch ($mode)
        {
            case "test":
                    $data  = $this ->test();
                 break;
            default:
                  
        }

        if (!$data && $data['code'] != 200) {
            $this->Ioc->Response->Json($data['code'], $data['msg'],'',$this ->out_mode);
        }

        $this->Ioc->Response->Json(200, '成功', $data,$this ->out_mode);
    }



}


$mode    = trim($_REQUEST['mode']);
$Index = new Index($Ioc);
$Index ->main($mode); 



